var mapIds = [993173600];
var 准备地图 = 993123000;

function init() {}

function setup(c, a) {
    em.setProperty("state", 1);
    em.setProperty("leader", "true");
    var c = em.newInstance("荣耀活动_支援塞尔提乌_歼灭侦察队");
    for (var b = 0; b < mapIds.length; b++) {
        var d = c.setInstanceMap(mapIds[b]);
        d.resetFully()
    }
    return c
}

function onPlayerRegistered(b, a) {
    a.setReviveCount(-100);
    var c = b.getMapInstance(0);
    a.changeMap(c, c.getPortal(0))
}

function onPlayerRevived(b, a) {
    return false
}

function onMapChanged(c, b, a) {
    em.setProperty("kill", "0");
    em.setProperty("level", "0");
    em.setProperty("clear", "0");
    em.setProperty("curMap", a);
    if (mapIds.indexOf(a) < 0) {
        on玩家退场(c, b, false);
        return
    }
}

function onPlayerDisconnected(b, a) {
    on玩家退场(b, a, false);
    return 0
}

function onMonsterDamaged(b, a, d, e, c) {}

function onTimeOut(a) {
    a.getPlayers().forEach(function (b) {
        on玩家退场(a, b, true)
    })
}

function onMonsterKilled(c, e, d) {
    var b = em.getNumberProperty("kill") + 1;
    em.setProperty("kill", b);
    var a = player.getAPI().addNumberForQuestInfo(100357, "mobCount", 1);
    if (a == 10) {
        player.getAPI().addPopupSay(9062211, 2000, "目前什么都没看见。再多消灭一些火花精灵吧。", "", 0)
    } else {
        if (a == 30) {
            player.getAPI().addPopupSay(9062211, 2000, "再多消灭几个精灵，或许就能找到侦察兵的痕迹了。", "", 0)
        } else {
            if (a == 50) {
                player.getAPI().setNumberForQuestInfo(100357, "state", 1);
                player.getAPI().getWeatherEffectNotice("请找出躲藏的侦察兵，在其附近按采集键发射闪光弹！", 297, 7000, 1);
                switch (c.rand(1, 4)) {
                    case 1:
                        player.getAPI().getMap().spawnReactorIfNotExist(9939051, 0, 1215, 30, 0, "gimmickReactor");
                        break;
                    case 2:
                        player.getAPI().getMap().spawnReactorIfNotExist(9939051, 0, 1215, -330, 0, "gimmickReactor");
                        break;
                    case 3:
                        player.getAPI().getMap().spawnReactorIfNotExist(9939051, 0, -225, 30, 0, "gimmickReactor");
                        break;
                    case 4:
                        player.getAPI().getMap().spawnReactorIfNotExist(9939051, 0, -225, -330, 0, "gimmickReactor");
                        break
                }
            }
        }
    }
    if (e == 9833691) {
        player.getAPI().fieldEffect_ScreenMsg("Map/Effect.img/fruitCollect/Success");
        player.getAPI().addPopupSay(9062210, 2000, "你辛苦了。把隐藏的那些家伙消灭后，内心真舒畅啊。", "", 0);
        player.getAPI().getWeatherEffectNotice("请消灭火花精灵，搜索躲藏的高等翼人侦察兵的痕迹。", 297, 7000, 1);
        player.getAPI().setNumberForQuestInfo(100357, "state", 0);
        player.getAPI().setNumberForQuestInfo(100357, "mobCount", 0);
        player.getAPI().addNumberForQuestInfo(100357, "lefCount", 1)
    }
}

function onPartyDisbanded(a) {}

function onPlayerKilled(b, a) {}
var setupTask;

function randomNum(b, a) {
    switch (arguments.length) {
        case 1:
            return parseInt(Math.random() * b + 1, 10);
            break;
        case 2:
            return parseInt(Math.random() * (a - b + 1) + b, 10);
            break;
        default:
            return 0;
            break
    }
}

function initProp(a, b) {
    if (em.getProperty(a) == null) {
        em.setProperty(a, b)
    }
}

function initPropArray(a, d, c, e) {
    for (var b = c; b <= e; b++) {
        if (em.getProperty(a + "_" + b) == null) {
            em.setProperty(a + "_" + b, d)
        }
    }
}

function on玩家退场(c, b, a) {
    c.disposeIfPlayerBelow(a ? 999 : 0, 准备地图);
    em.getProperties().clear();
    em.setProperty("state", 0);
    em.setProperty("leader", "true");
    c.unregisterPlayer(b)
}

function onItemPickedUp(b, a, c) {};